Help:Debugging
Script doesn't work? Here's what you need to know to fix it. Start by taking some time and checking out UBot's many features. If you've had some basic programming or scripting experience, you should have no problems familiarizing yourself with Visual Scripting Language. If you're brand new to scripting, following these guidelines when writing scripts will help you overcome many early frustrations and master even complex tasks within a few days of study and practice. How to debug your script UI elements You can create user-defined input boxes at the top of the UBot window. The UI allows you to enter information (variables, file locations, lists, or true-false checkboxes) when a bot first starts, or on the fly while a bot is running. The UI stat monitor also allows users to monitor variables and other information in realtime. Tip Creating a UI stat monitor to watch #status, then updating #status at the beginning of each sub will enable you to see which step you're on. Tip See what UBot scrapes by monitoring a #scraped variable when a script isn't scraping as it should. sub scripts The sub command is one of the most useful features in UBot. A sub is like a self contained script within a script. It helps you write cleaner and more maintainable code. Tip Subs will not run until you call one using the run sub command. pause / stop script You can tell UBot to wait until you start it again, so you see step by step how your script operates. TipIf you aren't sure which node isn't working correctly, pause after every sub or command to locate it. Warning If a while loop has an empty qualifier or is set to run indefinitely, UBot will hang until you force close the program. Pausing at the end of every loop you're testing will avoid this. delay Slowing down the script will also help you see what your script is (or isn't) doing. Tip You can use a $rand parameter to randomize the wait time. comment / disable coming soon! Probable causes for errors http://img198.imageshack.us/img198/4056/debug1.jpg http://img198.imageshack.us/img198/1007/debug2f.jpg Here we're attempting to set #saveTo to a nonexistent string at a nonexistent position within the %keywords list -- $listposition was not being incremented correctly (one higher than it should). When saving scraped keyword data for the last keyword in the list it would try to save a file, named something that didn't exist, because the second variable in savetofile ($listposition->%keywords {2}) had no value. So we get the error, index was out of range -- of available positions in a list. at System.Collections.Generic.List 1.getItem(Int32 index) http://img121.imageshack.us/img121/556/debug3.jpg http://img338.imageshack.us/img338/9340/debug4.jpg Here there are variable parameters {1} and {2}, but no parameters are defined. Again the problem is trying to work with something that isn't there (out of range), in this case a List of Parameters: at System.Collections.Generic.List 1.getItem(Int32 index) at System.Collections.ObjectMode.Collection 1.get_Item(Int32 index) http://images1.wikia.nocookie.net/ubot/images/7/7f/Resourceinuse.jpg ? http://images2.wikia.nocookie.net/ubot/images/7/78/Disposedobj.jpg ? http://images1.wikia.nocookie.net/ubot/images/f/fe/Marshaledinvokeoor.jpg ? http://images1.wikia.nocookie.net/ubot/images/a/ae/Windowhandle1.jpg ? http://images2.wikia.nocookie.net/ubot/images/0/0f/Strintconversion.jpg ? http://images1.wikia.nocookie.net/ubot/images/0/02/Valuenull.jpg ? Post your error screenshots And we'll work out a probable cause for it. How do you debug? Let us know!